using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using student_factory.Metier;

namespace student_factory.AffectationEtudiant
{
    public partial class ChoixProjet : Form
    {
        private IList<string> identifiants;
        public ChoixProjet()
        {
            identifiants = new List<string>();
            InitializeComponent();
        }

        private void bt_OK_Click(object sender, EventArgs e)
        {
            this.Hide();
            new ChoixProfil(identifiants[lst_projets.SelectedIndex]).ShowDialog();
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void ChoixProjet_Load(object sender, EventArgs e)
        {
            IList<Projet> projets = DAO.ProjetDAO.getNotFilledProj();

            foreach (Projet p in projets)
            {
                lst_projets.Items.Add(p.Prj_nom);
                identifiants.Add(p.Id_p);
            }
        }

        private void lst_projets_SelectedIndexChanged(object sender, EventArgs e)
        {
            bt_OK.Enabled = true;
        }
    }
}